$(function () {
    obj.init();
});
var obj = new function () {
    'use strict';
    return {
        dataGrid:null,
        init:function () {
            this.dataGrid = new xhDataGrid($('#list'),'ims/detail/getDetail');
            this.dataGrid.init().parseToolbar().activeButton([]);
            this.listener();
            this.funObj().bindDgEvent();
        },
        listener:function () {
            var $this = this;

            $('#bt_list_search').click(function () {
                $this.funObj().searchAction();
            })
        },
        funObj:function () {
            var $this = this;
            return {
                bindDgEvent:function () {
                    $this.dataGrid.onDblClickRow = function (rowIndex,rowData) {
                        window.top.xhTop.showModal({
                            title: rowData['sProdName']+'库存明细',
                            content: '<iframe src="'+baseUrl+'ims/detail/inOutList?iProdId='+rowData['iProdId']+'"  style="width: 100%;;border-style: none;padding: 0px;"  scrolling="yes"  height="450px;" ></iframe>',
                            size:'lg',
                            backClose:false
                        });
                    }
                },
                searchAction:function () {
                    $this.dataGrid.reload({
                        key:xhExtra.getValue($('#list_search')),
                        part:xhExtra.getValue($('#prod_part')),
                        brand:xhExtra.getValue($('#prod_brand'))
                    })
                }
            }
        }
    }
};